import request from '@/utils/request';

// 查询库存列表
export const listStock = (query: any) => {
  return request({
    url: '/system/stock/list',
    method: 'get',
    params: query
  });
}

// 查询库存详细
export const getStock = (stockId: any) => {
  return request({
    url: `/system/stock/${stockId}`,
    method: 'get'
  });
}

// 新增库存
export const addStock = (data: any) => {
  return request({
    url: '/system/stock',
    method: 'post',
    data: data
  });
}

// 修改库存
export const updateStock = (data: any) => {
  return request({
    url: '/system/stock',
    method: 'put',
    data: data
  });
}

// 删除库存
export const delStock = (stockId: any) => {
  return request({
    url: `/system/stock/${stockId}`,
    method: 'delete'
  });
}
